package cn.eli.vue.mapper.postAsk;

import cn.eli.vue.entity.PostAsk;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author :lzs
 * @Date : 2021-07-16
 * @Description :问题mapper层接口
 */

@Mapper
public interface PostAskMapper {
    /**************************              业务接口              *********************************/
    /*发布问题*/
    int AskPost(@Param("user_id")int user_id,@Param("postAsk_title")String postAsk_title,@Param("postAsk_discribe")String postAsk_describe,
                 @Param("postAsk_img")String postAsk_img);
    /*修改问题*/
    int AskModify(@Param("postAsk_id")int postAsk_id,@Param("postAsk_title")String postAsk_title,@Param("postAsk_discribe")String postAsk_describe,
                 @Param("postAsk_img")String postAsk_img);

    /*收藏问题 insert into tbl_subscribeAsk*/
    int AskSubscribeInsert(@Param("user_id")int user_id,@Param("postAsk_id")int postAsk_id);
    /*收藏问题 update tbl_postAsk*/
    int AskSubscribeUpdate(@Param("user_id")int user_id,@Param("postAsk_id")int postAsk_id);

    /*取消收藏问题 delete from tbl_subscribeAsk*/
    int AskSubscribeCancelDelete(@Param("user_id")int user_id,@Param("postAsk_id")int postAsk_id);
    /*取消收藏问题 update*/
    int AskSubscribeCancelUpdate(@Param("user_id")int user_id,@Param("postAsk_id")int postAsk_id);

    /*获取所有问题*/
    List<PostAsk> AllAsk();
    /*获取该用户发布的所有问题*/
    List<PostAsk> AllAskInUser(@Param("user_id")int user_id);
//    /*搜索问题*/
//    PostAsk TitleToPostAsk(@Param("postAsk_id")String postAsk_title);
}
